package com.wrx.server.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Collection;
//import 你自己的父类实体;

/**
 * <p>
 * 
 * </p>
 *
 * @author wrx
 * @since 2021-03-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_user")
@ApiModel(value="User对象", description="")
public class User implements Serializable, UserDetails {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "用户id")
    @TableId(value = "user_id", type = IdType.AUTO)
    private Integer userId;

    @ApiModelProperty(value = "用户账号")
    private String username;

    @ApiModelProperty(value = "用户密码")
    private String password;

    @ApiModelProperty(value = "用户网名")
    private String netname;

    @ApiModelProperty(value = "性别")
    private String sex;

    @ApiModelProperty(value = "年龄")
    private String age;

    @ApiModelProperty(value = "邮箱")
    private String email;

    @ApiModelProperty(value = "电话号码")
    private String telephone;

    @ApiModelProperty(value = "地址")
    private String address;

    @ApiModelProperty(value = "生日")
    private String birthday;

    @ApiModelProperty(value = "个性签名")
    private String sign;

    @ApiModelProperty(value = "用户权限")
    private String power;

    @ApiModelProperty(value = "账号注册时间")
    private LocalDateTime registertime;

    @ApiModelProperty(value = "头像图片地址")
    private String image;

    @ApiModelProperty(value = "是否启用")
    private boolean enabled;

    @ApiModelProperty(value = "收藏夹收藏数量")
    private Integer collect_number;

    @ApiModelProperty(value = "关注吧数量")
    private Integer bar_number;

    @ApiModelProperty(value = "发帖数量")
    private Integer put_theme_post_number;

    @ApiModelProperty(value = "回帖数量")
    private Integer reply_post_number;



    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    public User(Integer userId, String username, String password, String netname, String sex, String age, String email, String telephone, String address, String birthday, String sign, String power, LocalDateTime registertime, String image, boolean enabled, Integer collect_number, Integer bar_number, Integer put_theme_post_number, Integer reply_post_number) {
        this.userId = userId;
        this.username = username;
        this.password = password;
        this.netname = netname;
        this.sex = sex;
        this.age = age;
        this.email = email;
        this.telephone = telephone;
        this.address = address;
        this.birthday = birthday;
        this.sign = sign;
        this.power = power;
        this.registertime = registertime;
        this.image = image;
        this.enabled = enabled;
        this.collect_number = collect_number;
        this.bar_number = bar_number;
        this.put_theme_post_number = put_theme_post_number;
        this.reply_post_number = reply_post_number;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getReply_post_number() {
        return reply_post_number;
    }

    public void setReply_post_number(Integer reply_post_number) {
        this.reply_post_number = reply_post_number;
    }

    public Integer getCollect_number() {
        return collect_number;
    }

    public void setCollect_number(Integer collect_number) {
        this.collect_number = collect_number;
    }

    public Integer getBar_number() {
        return bar_number;
    }

    public void setBar_number(Integer bar_number) {
        this.bar_number = bar_number;
    }

    public Integer getPut_theme_post_number() {
        return put_theme_post_number;
    }

    public void setPut_theme_post_number(Integer put_theme_post_number) {
        this.put_theme_post_number = put_theme_post_number;
    }


    @Override
    public String getPassword() {
        return password;
    }

    @Override
    public String getUsername() {
        return username;
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return enabled;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return username;
    }

    public void setUserName(String userName) {
        this.username = userName;
    }

    public String getNetname() {
        return netname;
    }

    public void setNetname(String netname) {
        this.netname = netname;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public String getPower() {
        return power;
    }

    public void setPower(String power) {
        this.power = power;
    }

    public LocalDateTime getRegistertime() {
        return registertime;
    }

    public void setRegistertime(LocalDateTime registertime) {
        this.registertime = registertime;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
